package Homework13;

public class Teacher extends Person{
    private int work_age;
    public Teacher(String name, int age, char sex, int work_age) {
        super(name, age, sex);
        this.work_age = work_age;
    }

    public int getWork_age() {
        return work_age;
    }

    public void setWork_age(int work_age) {
        this.work_age = work_age;
    }

    public void teach(){
        System.out.println("我承诺，我会认真教课");
    }

    @Override
    public String play() {
        return super.play() + "象棋";
    }

    @Override
    public void printInfo() {
        super.printInfo();
        System.out.println("工龄：" + work_age);
        teach();
        System.out.println(this.play());
    }


}
